package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.social.pojo.ApUserLike;
import com.zhentao.service.ApUserLikeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("api/v1/user/like")
@Api(tags = "UserLikeController-点赞管理")
public class UserLikeController {
    @Resource
    ApUserLikeService apUserLikeService;

    @PostMapping("/addLike")
    @ApiOperation("添加点赞记录")
    public ResponseResult addLike(@RequestBody ApUserLike apUserLike){
        return apUserLikeService.addLike(apUserLike);
    }

    @PostMapping("/list")
    @ApiOperation("点赞记录列表")
    public ResponseResult likeList(@RequestParam("id") Integer id){
        return apUserLikeService.getList(id);
    }

    @PostMapping("/del")
    @ApiOperation("取消点赞")
    public ResponseResult del(@RequestBody ApUserLike apUserLike){
        return apUserLikeService.delLike(apUserLike);
    }









}
